package com.tools.ad.ui.crad.view;

import android.content.Context;
import android.support.annotation.NonNull;

import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
import com.hm.adsui.card.SmallNativeAdCardView;
import com.hm.base.android.ui.glide.RoundTransform;
import com.hm.base.android.ui.util.ScreenUtil;
import com.tools.ad.R;

/**
 * Created by ChenLi on 2018/3/5.
 */

public class DapReplaceCardView extends SmallNativeAdCardView {
    public DapReplaceCardView(@NonNull Context context) {
        super(context);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.dap_replace_card_layout;
    }

    @Override
    protected BitmapTransformation getCoverBitmapTransform() {
        RoundTransform transform = new RoundTransform(this.mContext);
        transform.setTopLeftRound(false);
        transform.setTopRightRound(false);
        transform.setBottomLeftRound(false);
        transform.setBottomRightRound(false);
        transform.setHeight(ScreenUtil.dp2px(mContext, 167));
        transform.setWidth(ScreenUtil.getScreenWidth(mContext) - ScreenUtil.dp2px(mContext, 10));
        return transform;
    }
}
